package factory;

import java.util.ResourceBundle;

public class UserFactory {

	public static ResourceBundle bundle;
	static {
		bundle = ResourceBundle.getBundle("instance");
	}

	@SuppressWarnings("unchecked")
	public static <T> T getInstance(String key, Class<T> classType) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		String className = bundle.getString(key);
		return (T)Class.forName(className).newInstance();
	}
}
